package com.fay.designPattern.oop.basic;

import java.awt.*;
import java.awt.image.BufferedImage;

/**
 * @Title:
 * @Description:
 * @Author Fay Wang
 * @Date 2022/2/21 20:35
 * @Version 1.0
 */
public class ImageProcessingJob {
    private static final String BUCKET_NAME = "ali_images_bucket";

    public void process() {
        Image image = new BufferedImage(1, 2, 3);//处理图片，并封装为Image对象
        AliyunImageStore imageStore = new AliyunImageStore();
        imageStore.createBucketIfNotExisting(BUCKET_NAME);
        String accessToken = imageStore.generateAccessToken();
        imageStore.uploadToAliyun(image, BUCKET_NAME, accessToken);
    }

    public void process1() {
        Image image = new BufferedImage(1, 2, 3);
        ImageStore imageStore = new PriavateImageStore();
        imageStore.upload(image, BUCKET_NAME);
    }
}
